package com.woniuxy.service.impl;


import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.woniuxy.dao.SysLogMapper;
import com.woniuxy.pojo.SysLog;
import com.woniuxy.service.SysLogService;
import com.woniuxy.util.DataGridView;
import com.woniuxy.vo.SysLogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysLogServiceImpl implements SysLogService {

    @Autowired
    private SysLogMapper sysLogMapper;
    @Override
    public void saveLog(SysLog sysLog) {
        this.sysLogMapper.saveLog(sysLog);
    }

    @Override
    public DataGridView findAllsysLogs(SysLogVo sysLogVo) {
        Page<Object> page= PageHelper.startPage(sysLogVo.getPage(),sysLogVo.getLimit());
        List<SysLog> sysLogsList = this.sysLogMapper.selectAllsysLogs();
        return new DataGridView(page.getTotal(),sysLogsList);
    }


}
